<?php
$type = 1;
if ($type==1){
    $chars = join("", range(0, 9));
}elseif ($type==2){
    $chars = join("", array_merge(range("a", "z"),range("A", "Z")));
      
}